package cn.org.donald.controller.system;


import cn.org.donald.framework.pojo.vo.TableResult;
import cn.org.donald.pojo.dto.system.QueryLogOperatorDto;
import cn.org.donald.pojo.entity.system.LogOperator;
import cn.org.donald.service.system.LogOperatorService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import cn.org.donald.framework.base.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Donald
 * @since 2020-12-29
 */
@RestController
@RequestMapping("/log-operator")
@Api(value = "操作日志")
public class LogOperatorController extends BaseController {

    @Reference(version = "1.0.0", group = "donald")
    private LogOperatorService logOperatorService;

    @PostMapping("/page")
    @ApiOperation(value = "分页查询操作日志")
    public TableResult page(@Validated @RequestBody QueryLogOperatorDto queryLogOperatorDto, BindingResult bindingResult) {
        IPage<LogOperator> page = logOperatorService.selectPage(queryLogOperatorDto);
        return toTableResult(page);
    }
}

